home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / psion / syscalls.2 < prev    next >
Text File  |  1995-03-31  |  35KB  |  1,064 lines

  1. PSIONICS FILE - SYSCALLS.2
  2. ==========================
  3. System calls (part 2)
  4. Last modified 1994-09-06
  5. ========================
  6.  
  7. See part 1 for general notes and explanations.
  8.  
  9.  
  10. Fn $88 Sub $00
  11. ProcId
  12.     AX: -> process ID of the current process
  13. Gets the process ID of the current process.
  14.  
  15.  
  16. Fn $88 Sub $01
  17. ProcIdByName fails
  18.     AX: -> process ID
  19.     BX: (cstr) pattern
  20. Gets the process ID of a process whose name matches the pattern (usual
  21. wildcards apply, and case is ignored).
  22.  
  23.  
  24. Fn $88 Sub $02
  25. ProcGetPriority fails
  26.     AL: -> priority
  27.     BX: process ID
  28. Gets the priority of the specified process.
  29.  
  30.  
  31. Fn $88 Sub $03
  32. ProcSetPriority fails
  33.     AL: new priority
  34.     BX: process ID
  35. Sets the priority of the specified process.
  36.  
  37.  
  38. Fn $88 Sub $04 should not be used.
  39.  
  40.  
  41. Fn $88 Sub $05
  42. ProcCreateTask
  43. Tasks are processes which share the data segment of another process. They
  44. cannot be conveniently handled in OPL.
  45.  
  46.  
  47. Fn $88 Sub $06
  48. ProcResume fails
  49.     BX: process ID
  50. Take a process out of the suspended state and start it executing.
  51.  
  52.  
  53. Fn $88 Sub $07
  54. ProcSuspend fails
  55.     BX: process ID
  56. Place a process in the suspended state. If the process is waiting for a system
  57. service (e.g. a semaphore), then it will be suspended when the service has
  58. been carried out.
  59.  
  60.  
  61. Fn $88 Sub $08
  62. ProcKill fails
  63.     AL: reason code
  64.     BX: process ID
  65. Kills the specified process, without allowing it to execute any cleanup code.
  66. Only use this on the current process or in emergencies.
  67.  
  68.  
  69. Fn $88 Sub $09
  70. ProcPanicById fails
  71.     AL: panic code
  72.     BX: process ID
  73. Simulate the specified panic on the specified process.
  74.  
  75.  
  76. Fn $88 Sub $0A
  77. ProcNameById fails
  78.     BX: process ID
  79.     DI: 13 byte buffer
  80. Places the name (a cstr) of the specified process in the buffer.
  81.  
  82.  
  83. Fn $88 Sub $0B
  84. ProcFind fails
  85.     AX: -> process ID
  86.     BX: 0 or process ID
  87.     SI: 14 byte buffer
  88.     DI: (cstr) pattern
  89. Obtains process IDs for processes whose name matches the pattern ("?" and "*"
  90. wildcards have their Unix meaning, and case is ignored). BX should be zero to
  91. return the first matching process, or the process ID returned by a previous
  92. call to return subsequent matching processes. Process are returned in *task*
  93. ID order. The buffer is filled with a cstr giving the process name.
  94.  
  95.  
  96. Fn $88 Sub $0C
  97. ProcRename fails
  98.     BX: process ID
  99.     DI: (cstr) new name
  100. Rename the specified process; the new name must be between 1 and 8 characters.
  101.  
  102.  
  103. Fn $88 Sub $0D
  104. ProcTerminate fails
  105.     BX: process ID
  106. Terminates the indicated process. The process will be sent a termination
  107. message if it has so requested, and will be killed otherwise.
  108.  
  109.  
  110. Fn $88 Sub $0E
  111. ProcOnTerminate
  112.     BX: message type
  113. When the current process is terminated, it will be sent a message of the
  114. specified type; type 0 cancels the request. After receiving the message and
  115. executing any clean-up code, the process should use ProcKill to kill itself.
  116.  
  117.  
  118. Fn $88 Sub $0F is reserved for the Shell process.
  119.  
  120.  
  121. Fn $88 Sub $10
  122. ProcGetOwner fails
  123.     AX: -> owning process ID
  124.     BX: process ID
  125. Gets the ID of the process owning the specified process (normally the
  126. creator of that process).
  127.  
  128.  
  129. Fn $89 Sub $00
  130. TimSleepForTenths fails
  131.     CX: high half of delay
  132.     DX: low half of delay
  133. Sleep for the specified delay (in units of 0.1 seconds). Changing the system
  134. clock does not affect the call. Only time when the machine is switched on is
  135. measured; any time when the machine is switched off will be in addition to
  136. the requested delay.
  137.  
  138.  
  139. Fn $89 Sub $01
  140. TimSleepForTicks fails
  141.     CX: high half of delay
  142.     DX: low half of delay
  143. Sleep for the specified delay (in system ticks; there are 32 ticks per second
  144. on the Series 3 and 18.2 on the PC emulation). Changing the system clock does
  145. not affect the call. Only time when the machine is switched on is measured;
  146. any time when the machine is switched off will be in addition to the requested
  147. delay.
  148.  
  149.  
  150. Fn $89 Sub $02
  151. TimGetSystemTime
  152.     AX: -> high half of system clock
  153.     BX: -> low half of system clock
  154. Reads the system clock (an abstime).
  155.  
  156.  
  157. Fn $89 Sub $03
  158. TimSetSystemTime
  159.     CX: high half of new system clock
  160.     DX: low half of new system clock
  161. Sets the system clock to the given abstime.
  162.  
  163.  
  164. Fn $89 Sub $04
  165. TimSystemTimeToDaySeconds
  166.     CX: high half of abstime
  167.     DX: low half of abstime
  168.     DI: 8 byte buffer
  169. Splits an abstime into a day number and an interval, placed in the buffer as
  170. follows:
  171.   Offset  0 (long): day number
  172.   Offset  4 (long): interval
  173.  
  174.  
  175. Fn $89 Sub $05
  176. TimDaySecondsToSystemTime fails
  177.     AX: -> high half of abstime
  178.     BX: -> low half of abstime
  179.     DI: 8 byte buffer
  180. Converts a day number and an interval to an abstime. The former are in the
  181. buffer, in the same format as TimSystemTimeToDaySeconds.
  182.  
  183.  
  184. Fn $89 Sub $06
  185. TimDaySecondsToDate fails
  186.     SI: 8 byte buffer (day number and interval)
  187.     DI: 8 byte buffer (broken down time)
  188. Converts a day number and an interval to broken-down time information. The
  189. former is in the same format as TimSystemTimeToDaySeconds. The latter is in
  190. the format:
  191.   Offset  0 (byte): year - 1900
  192.   Offset  1 (byte): month (0 = January, 11 = December)
  193.   Offset  2 (byte): day - 1
  194.   Offset  3 (byte): hours
  195.   Offset  4 (byte): minutes
  196.   Offset  5 (byte): seconds
  197.   Offset  6 (word): day number in year (0 to 364 or to 365)
  198.  
  199.  
  200. Fn $89 Sub $07
  201. TimDateToDaySeconds fails
  202.     SI: 8 byte buffer (broken down time)
  203.     DI: 8 byte buffer (day number and interval)
  204. Converts broken-down time to a day number and an interval.
  205.  
  206.  
  207. Fn $89 Sub $08
  208. TimDaysInMonth fails
  209.     AX: -> number of days in month
  210.     CX: month * 256 + year - 1900
  211. Gets the number of days in the specified month (0 = January, 11 = December).
  212.  
  213.  
  214. Fn $89 Sub $09
  215. TimDayOfWeek
  216.     AX: -> day of week (0 = Monday, 6 = Sunday)
  217.     CX: high half of day number
  218.     DX: low half of day number
  219. Gets the day of the week of the given date.
  220.  
  221.  
  222. Fn $89 Sub $0A
  223. TimNameOfDay fails
  224.     AL: day of week (0 = Monday, 6 = Sunday)
  225.     BX: 33 byte buffer
  226. The buffer is filled with a cstr giving the name of that day of the week.
  227.  
  228.  
  229. Fn $89 Sub $0B
  230. TimNameOfMonth fails
  231.     AL: month (0 = January, 11 = December)
  232.     BX: 33 byte buffer
  233. The buffer is filled with a cstr giving the name of that month.
  234.  
  235.  
  236. Fn $89 Sub $0C
  237. TimWaitAbsolute fails
  238.     CX: high half of abstime
  239.     DX: low half of abstime
  240. Sleep this process until the specified abstime. If the machine is turned off
  241. at that time, it will turn back on. Changing the system clock will affect
  242. when the call returns.
  243.  
  244.  
  245. Fn $89 Sub $0D
  246. TimWeekNumber fails
  247.     AX: -> week number (1 to 53)
  248.     CX: high half of day number
  249.     DX: low half of day number
  250. Gets the week number of the specified day.
  251.  
  252.  
  253. Fn $89 Sub $0E
  254. TimNameOfDayAbb v3 fails
  255.     AL: day of week (0 = Monday, 6 = Sunday)
  256.     BX: 4 byte buffer
  257. The buffer is filled with a cstr giving the abbreviated name of that day of
  258. the week.
  259.  
  260.  
  261. Fn $89 Sub $0F
  262. TimNameOfMonthAbb v3 fails
  263.     AL: month (0 = January, 11 = December)
  264.     BX: 4 byte buffer
  265. The buffer is filled with a cstr giving the abbreviated name of that month.
  266.  
  267.  
  268. Fn $8A Sub $00
  269. ConvUnsignedIntToBuffer
  270.     AX: -> length of converted value
  271.     BX: value to be converted
  272.     CX: radix
  273.     DI: buffer to hold converted value
  274. The value is converted to a string in the specified radix and written to the
  275. buffer. No trailing zero byte is written; instead, the length of the string
  276. is returned. The radix can be any value from 2 to 200. If the radix is 11 or
  277. greater, digits greater than 9 are written as "A", "B", etc; characters other
  278. than digits and uppercase letters are used when the radix is 37 or more.
  279.  
  280.  
  281. Fn $8A Sub $01
  282. ConvUnsignedLongIntToBuffer
  283.     AX: -> length of converted value
  284.     BX: low half of value to be converted
  285.     CX: radix
  286.     DX: high half of value to be converted
  287.     DI: buffer to hold converted value
  288. The value is converted to a string, in the same way as ConvUnsignedIntToBuffer.
  289.  
  290.  
  291. Fn $8A Sub $02
  292. ConvIntToBuffer
  293.     AX: -> length of converted value
  294.     BX: value to be converted
  295.     DI: buffer to hold converted value
  296. The value is converted to a string in radix 10 and written to the buffer. If
  297. the value is negative, a leading "-" will be included. No trailing zero byte
  298. is written; instead, the length of the string is returned.
  299.  
  300.  
  301. Fn $8A Sub $03
  302. ConvLongIntToBuffer
  303.     AX: -> length of converted value
  304.     BX: low half of value to be converted
  305.     DX: high half of value to be converted
  306.     DI: buffer to hold converted value
  307. The value is converted to a string in radix 10, as for ConvIntToBuffer.
  308.  
  309.  
  310. Fn $8A Sub $04
  311. ConvArgumentsToBuffer
  312.     AX: -> length of converted format
  313.     BX: buffer holding the format arguments
  314.     DI: buffer to hold converted format
  315.     SI: (cstr) format
  316. The format is written to the buffer, with certain sequences of characters -
  317. "conversion specifiers" - being replaced by the values of arguments converted
  318. to strings. No trailing zero byte is written; instead, the length of the string
  319. is returned.
  320.  
  321. All conversion specifiers begin with a percent sign (to include a literal
  322. percent in the output, use "%%"), followed by:
  323. - an optional alignment code
  324. - an optional width code (required if there is an alignment code)
  325. - an optional length code
  326. - a conversion code.
  327.  
  328. The alignment code consists of two characters. The first is:
  329. - "-": left align (fill on the right)
  330. - "=": centre align (fill at both ends)
  331. - "+": right align (fill on the left).
  332. The second is either the character to fill with, or "*". In the latter case,
  333. the next word is taken from the arguments and used as the fill character.
  334. The default alignment is to right align filling with spaces ("+ "). Also, the
  335. alignment "+0" may be abbreviated to "0".
  336.  
  337. The width code gives the number of characters generated by the conversion. If
  338. the output would be longer, it is truncated. The code is either an unsigned
  339. decimal number (not beginning with a zero), or "*". In the latter case, the
  340. next word is taken from the arguments and gives the (unsigned) width.
  341.  
  342. The length code can be "l" or "L" (equivalent); it is equivalent to making the
  343. conversion code uppercase.
  344.  
  345. Each conversion code (apart from "f") takes an argument of the type stated,
  346. and then converts it as described.
  347.  
  348.   Code  Type  Conversion
  349.  
  350.   "b"   word  convert to unsigned binary representation
  351.   "B"   long  convert to unsigned binary representation
  352.   "c"   word  output the character with that code
  353.   "C"   long  output the character with that code
  354.   "d"   word  convert to signed decimal representation
  355.   "D"   long  convert to signed decimal representation
  356.   "f"   ----  output an empty string filled with the fill character.
  357.   "F"   ----  output an empty string filled with the fill character.
  358.   "o"   word  convert to unsigned octal representation
  359.   "O"   long  convert to unsigned octal representation
  360.   "m"   word  output the value as 2 bytes, least significant first
  361.   "M"   long  output the value as 4 bytes, least significant first
  362.   "s"   cstr  output the cstr
  363.   "S"   cstr  output the cstr
  364.   "u"   word  convert to unsigned decimal representation
  365.   "U"   long  convert to unsigned decimal representation
  366.   "w"   word  output the value as 2 bytes, most significant first
  367.   "W"   long  output the value as 4 bytes, most significant first
  368.   "x"   word  convert to unsigned hexadecimal representation
  369.   "X"   long  convert to unsigned hexadecimal representation
  370. Codes "m", "M", "w", and "W" are available in EPOC v2.17 and later only.
  371.  
  372.  
  373. Fn $8A Sub $05
  374. ConvStringToUnsignedInt fails
  375.     AX: -> converted value
  376.     CX: radix
  377.     SI: (cstr) string to convert -> pointer to first unused character
  378. The string is converted to an unsigned integer in the specified radix. The
  379. conversion ends at the first character which is not a valid digit for the
  380. radix, which may be the terminating zero byte; if the first character of the
  381. string is not valid, the call fails. The letters A to F, in either case, are
  382. used for digits 10 to 15 if the radix is 11 or more. The radix may be greater
  383. than 16, but the valid digits remain restricted to the range 0 to 15.
  384.  
  385.  
  386. Fn $8A Sub $06
  387. ConvStringToUnsignedLongInt fails
  388.     AX: -> high half of converted value
  389.     BX: -> low half of converted value
  390.     CX: radix
  391.     SI: (cstr) string to convert -> pointer to first unused character
  392. The string is converted, in the same manner as ConvStringToUnsignedInt.
  393.  
  394.  
  395. Fn $8A Sub $07
  396. ConvStringToInt fails
  397.     AX: -> converted value
  398.     SI: (cstr) string to convert -> pointer to first unused character
  399. The string is converted to an signed integer in radix 10. The conversion ends
  400. at the first character which is not a valid digit or leading sign; this may
  401. be the terminating zero byte. If the first character of the string is not a
  402. digit or sign, the call fails.
  403.  
  404.  
  405. Fn $8A Sub $08
  406. ConvStringToLongInt
  407.     AX: -> high half of converted value
  408.     BX: -> low half of converted value
  409.     SI: (cstr) string to convert -> pointer to first unused character
  410. The string is converted, in the same manner as ConvStringToInt.
  411.  
  412.  
  413. Fn $8A Sub $09
  414. ConvFloatToBuffer fails
  415.     AX: -> length of converted value
  416.     DX: pointer to 6 byte conversion information block
  417.     SI: address of real value to be converted
  418.     DI: buffer to hold converted value
  419. The real value is converted to a cstr and placed in the buffer. The exact
  420. format of the string depends on the contents of the conversion information
  421. block:
  422.   Offset  0 (byte): 0 = fixed format, 1 = exponent format, 2 = variable format
  423.   Offset  1 (byte): maximum length of converted value
  424.   Offset  2 (byte): number of decimal digits (fixed and exponent formats only)
  425.   Offset  3 (byte): radix character
  426.   Offset  4 (byte): triad character (fixed format only)
  427.   Offset  5 (byte): triad threshold (fixed format only)
  428. If the converted value would be greater than the maximum length, or the real
  429. to be converted has an exponent less than -99 or greater than 99, the call
  430. fails and the contents of the buffer are undefined (note that the length
  431. of the buffer need only be the maximum specified plus an extra byte for the
  432. terminating zero).
  433.  
  434. For fixed format, the resulting string will take the form:
  435.   * minus sign if the value is negative; nothing if it is positive
  436.   * the integer part of the number, with no leading zeros (one zero if the
  437.     integer part is zero); if the triad threshold is non-zero and there are
  438.     more than that number of digits in the integer part, then the triad
  439.     character is inserted between groups of 3 digits
  440.   * if the number of decimal digits is non-zero:
  441.     - the radix character
  442.     - the specified number of digits
  443. For example, the number 1234321.4731 is converted as follows (assuming that
  444. the radix character is "." and the triad character is ","):
  445.     0 decimal digits, triad threshold 0: "1234321"
  446.     0 decimal digits, triad threshold 5: "1,234,321"
  447.     0 decimal digits, triad threshold 7: "1234321"
  448.     2 decimal digits, triad threshold 5: "1,234,321.47"
  449.     6 decimal digits, triad threshold 1: "1,234,321.473100"
  450.  
  451. For floating format, the resulting string will take the form:
  452.   * minus sign if the value is negative; nothing if it is positive
  453.   * one non-zero digit
  454.   * if the number of decimal digits is non-zero:
  455.     - the radix character
  456.     - the specified number of digits
  457.   * the letter "E"
  458.   * a plus or minus sign
  459.   * two digits (using leading zeros if necessary)
  460. For example, the number 1234321.4731 is converted as follows:
  461.     0 decimal digits: "1E+06"
  462.     2 decimal digits: "1.23E+06"
  463.     7 decimal digits: "1.234321E+06"
  464.    12 decimal digits: "1.234321473100E+06"
  465. Zero (with either sign) is always converted as "0E+00" or "0.000E+00" etc.
  466.  
  467. For general format the resulting string will take a form depending on its
  468. value. If the maximum width is W and the real value is R, then:
  469.                R <= -1E+(W-1)  as for exponent format with W-7 decimal digits
  470.   -1E+(W-1) <  R <= -1E+(W-2)  a string containing a minus sign and W-1 digits
  471.   -1E+(W-2) <  E <= -1E+(W-1)  a string containing a minus sign and W-2 digits
  472.   -1E+(W-3) <  R <= -1E-4      a string containing a minus sign and then W-2
  473.                                significant digits with the radix character in
  474.                                the appropriate position
  475.   -1E-4     <  R <  0          as for exponent format with W-7 decimal digits
  476.   0         =  R               the string "0"
  477.   0         <  R < 1E-4        as for exponent format with W-6 decimal digits
  478.   1E-4      <= R < 1E+(W-2)    a string containing W-1 significant digits with
  479.                                the radix character in the appropriate position
  480.   1E+(W-2)  <= E < 1E+(W-1)    a string containing W-1 digits
  481.   1E+(W-1)  <= E < 1E+(W)      a string containing W digits
  482.   1E+(W)    <= R               as for exponent format with W-7 decimal digits
  483.  
  484.  
  485. Fn $8A Sub $0A
  486. ConvStringToFloat fails
  487.     DX: radix character
  488.     SI: (cstr) string to convert
  489.     DI: address of real variable to be set
  490. Converts a string representing a floating-point value and places it in the
  491. variable. The string must have the form:
  492.   * an optional sign
  493.   * a mantissa containing at least one digit and an optional radix character
  494.   * an optional exponent consisting of:
  495.     - the letter "E" or "e"
  496.     - an optional sign
  497.     - an integer
  498. The resulting value must have an exponent in the range -99 to 99 inclusive.
  499. If it is outside this range, the call fails; for underflow the value 0 is
  500. stored, while for overflow an undefined value is stored.
  501.  
  502.  
  503. Fn $8B Sub $00
  504. GenVersion
  505.     AX: -> kernel version
  506. Gets the version of the operating system. Version 1.23 is reported as:
  507.     $123A for alpha release
  508.     $123B for beta release
  509.     $123F for final release
  510.  
  511.  
  512. Fn $8B Sub $01
  513. GenLcdType
  514.     AL: -> display type
  515. Gets the display type:
  516.      0 = 640x400 LCD
  517.      1 = 640x200 LCD small version
  518.      2 = 640x200 LCD large version or CGA (PC emulation)
  519.      3 = 720x348 LCD or Hercules graphics
  520.      4 = 160x80  LCD
  521.      5 = 240x80  LCD (Series 3s)
  522.      6 = MDA (PC emulation)
  523.      7 = EGA monochrome (PC emulation)
  524.      8 = EGA colour     (PC emulation)
  525.      9 = VGA monochrome (PC emulation)
  526.     10 = VGA colour     (PC emulation)
  527.     11 = 480x160 LCD (Series 3a)
  528.    255 = unknown
  529.  
  530.  
  531. Fn $8B Sub $02
  532. GenStartReason
  533.     AL: -> reason code
  534. Gets the reason for the last cold start:
  535.     0 = system RAM invalid
  536.     1 = forced power down (only happens if a device driver is faulty)
  537.     2 = user reset (using reset button)
  538.     3 = kernel fault
  539.     4 = new operating system installed
  540. The environment variables and the internal disc are valid after reasons 1 and
  541. 3, and are valid after reason 2 unless ESC was also pressed.
  542.  
  543.  
  544. Fn $8B Sub $03
  545. GenParse fails
  546.     BX: 18 byte buffer
  547. Parse filenames according to certain basic rules. Unlike FilParse, this does
  548. not invoke any device drivers. The buffer has the format:
  549.   Offset  0 (word): address of file name 1 (a cstr)
  550.   Offset  2 (word): address of file name 2 (a cstr)
  551.   Offset  4 (word): address of file name 3 (a cstr)
  552.   Offset  6 (word): address of buffer to be filled with final name (a cstr)
  553.   Offset  8 (word): address of 6 byte buffer
  554.   Offset 10 (byte): device separator
  555.   Offset 11 (byte): path separator
  556.   Offset 12 (byte): extension separator
  557.   Offset 13 (byte): maximum length of device including separators
  558.   Offset 14 (byte): maximum length of path including separators
  559.   Offset 15 (byte): maximum length of name
  560.   Offset 16 (byte): maximum length of extension including separator
  561. The three filenames are split into 5 components, any of which may be missing.
  562.   * node (ends with "::")
  563.   * device (ends with device separator)
  564.   * path (ends with last path separator)
  565.   * name
  566.   * extension (starts with extension separator)
  567. The final name is constructed by taking, for each component, the value from
  568. file name 1 if present, otherwise the value from file name 2 if present,
  569. and otherwise the value from file name 3. The 6 byte buffer is then filled in
  570. with the same data as for FilParse.
  571.  
  572.  
  573. Fn $8B Sub $04
  574. LongUnsignedIntRandom
  575.     AX: -> high half of random number
  576.     BX: address of seed -> low half of random number
  577. Generates a 32 bit unsigned random number from a seed; the number also replaces
  578. the seed, so that the sequential calls with the same seed address will generate
  579. a random sequence based on the initial seed.
  580.  
  581.  
  582. Fn $8B Sub $05
  583. GenGetCountryData
  584.     BX: 40 byte buffer
  585. Fills the buffer with country-specific data:
  586.   Offset  0 (word): country code (e.g. UK is 44) of locale
  587.   Offset  2 (word): current offset from GMT in minutes (+ is ahead)
  588.   Offset  4 (byte): date format (0 = MDY, 1 = DMY, 2 = YMD)
  589.   Offset  5 (byte): time format (0 = am-pm, 1 = 24 hour)
  590.   Offset  6 (byte): currency symbol position (0 = before, 1 = after)
  591.   Offset  7 (byte): currency symbol separated with space (0 = yes, 1 = no)
  592.   Offset  8 (byte): currency decimal places
  593.   Offset  9 (byte): currency negative format (0 = minus, 1 = brackets)
  594.   Offset 10 (byte): currency group digits in threes
  595.                     (0 = no, any other value is maximum ungrouped length)
  596.   Offset 11 (byte): thousands separator
  597.   Offset 12 (byte): decimal separator
  598.   Offset 13 (byte): date separator
  599.   Offset 14 (byte): time separator
  600.   Offset 15 to  23: currency symbol (cstr)
  601.   Offset 24 (byte): start of week (0 = Mon, 1 = Tue, ... 6 = Sun)
  602.   Offset 25 (byte): currently active summer times:
  603.     Bit 0:       home
  604.     Bit 1:       European
  605.     Bit 2:       Northern
  606.     Bit 3:       Southern
  607.     Bits 4 to 7: unused, always zero
  608.   Offset 26 (byte): clock type (0 = analogue, 1 = digital)
  609.   Offset 27 (byte): number of letters in day abbreviation (0 to 6)
  610.   Offset 28 (byte): number of letters in month abbreviation (0 to 255)
  611.   Offset 29 (byte): workdays (the set bits indicate the workdays)
  612.     Bit 0: Monday
  613.     Bit 1: Tuesday
  614.     Bit 2: Wednesday
  615.     Bit 3: Thursday
  616.     Bit 4: Friday
  617.     Bit 5: Saturday
  618.     Bit 6: Sunday
  619.     Bit 7: always zero
  620.   Offset 30 (byte): units (0 = inches, 1 = centimetres)
  621.  
  622.  
  623. Fn $8B Sub $06
  624. GenGetErrorText
  625.     AL: error number
  626.     BX: 64 byte buffer
  627. The buffer will be filled with a cstr giving an error message corresponding to
  628. the error number (a generic message including the number is used when there is
  629. no stored message in the current locale).
  630.  
  631.  
  632. Fn $8B Sub $07
  633. GenGetOsData
  634.     CX: number of bytes to fetch
  635.     SI: offset of first byte in kernel workspace
  636.     DI: buffer to be filled in
  637. Copy a number of bytes from the kernel workspace to the current process.
  638. Within assembler code, this can also be done via GenDataSegment (see Psionics
  639. file KERNEL).
  640.  
  641.  
  642. Fn $8B Sub $08 only applies to MC systems.
  643.  
  644.  
  645. Fn $8B Sub $09
  646. GenNotify fails
  647.     AL: -> option chosen (0 = first, 1 = second, 2 = third)
  648.     BX: first message  (cstr, up to 63 characters plus the terminating zero)
  649.     CX: second message (cstr, up to 63 characters plus the terminating zero)
  650.     DX: first option   (cstr, up to 15 characters plus the terminating zero)
  651.     SI: second option  (cstr, up to 15 characters plus the terminating zero)
  652.     DI: third option   (cstr, up to 15 characters plus the terminating zero)
  653. Sends a message to the notifier process and waits for a reply. The call fails
  654. if there is no notifier process running. The two messages are displayed, and
  655. the user is offered the three options. The chosen option is returned.
  656.  
  657. Any of the arguments except BX may be zero instead; for CX this means that
  658. only one message is displayed, while for DX, SI, and DI it means that less
  659. options are offered (if all are zero, the option "CONTINUE" is offered).
  660.  
  661.  
  662. Fn $8B Sub $0A
  663. GenNotifyError fails
  664.     AL: error number -> option chosen (0 = first, 1 = second, 2 = third)
  665.     BX: first message
  666.     DX: first option
  667.     SI: second option
  668.     DI: third option
  669. This call is equivalent to GenNotify with the second message derived from the
  670. error number via GenGetErrorText.
  671.  
  672.  
  673. Fn $8B Sub $0B and $0C are used by the notifier process.
  674.  
  675.  
  676. Fn $8B Sub $0D
  677. GenGetRamSizeInParas
  678.     AX: -> system RAM size
  679. Gets the amount of system RAM fitted, in units of 16 bytes.
  680.  
  681.  
  682. Fn $8B Sub $0E
  683. GenGetCommandLine
  684.     AX: -> zero or command line
  685. Gets a pointer to the command line if the program was started with program
  686. information (see FilExecute). If so, the command line consists of a cstr giving
  687. the program executed, immediately followed by the program information (a qstr).
  688.  
  689.  
  690. Fn $8B Sub $0F
  691. GenGetSoundFlags
  692.     BX: -> sound flags
  693. Gets the sound flags:
  694.     Bit 0: keyboard clicks enabled
  695.     Bit 1: sound via piezo buzzer enabled
  696.     Bit 2: sound via SND: device driver enabled
  697.     Bit 3: set=loud, clear=soft
  698.     Bit 4: set=disable all sound, clear=obey individual flags
  699.  
  700.  
  701. Fn $8B Sub $10
  702. GenSetSoundFlags
  703.     AX: sound flags
  704. Sets the sound flags to new values (see GenGetSoundFlags).
  705.  
  706.  
  707. Fn $8B Sub $11
  708. GenSound
  709.     BX: duration in ticks
  710.     CX: pitch code (frequency=512kHz/code)
  711. Makes a simple single-frequency note. Access to this call is sequenced; it
  712. will wait until the piezo buzzer is not in use, and will return when the sound
  713. has started to play.
  714.  
  715.  
  716. Fn $8B Sub $12
  717. GenMarkActive
  718. Fn $8B Sub $13
  719. GenMarkNonActive
  720.  
  721. These two calls alter the state of the current process to "active" (the default
  722. when the process starts) or "non-active". Whenever an active process restarts
  723. execution after being idle (basically when keywords such as IOWAIT, IOW, GET
  724. and so on return), the auto-off timer is reset; the machine switches off when
  725. the timer reaches the appropriate value.
  726.  
  727.  
  728. Fn $8B Sub $14
  729. GenGetText fails
  730.     AL: message number
  731.     BX: 64 byte buffer
  732. Copies a message (a cstr) from the kernel message table to the buffer.
  733.  
  734.  
  735. Fn $8B Sub $15
  736. GenGetNotifyState
  737.     AL: -> notify state (0=unattended, 1=notify)
  738. Gets the notify state for the process. If this is "unattended", then the file
  739. server will not call the notifier process when a correctable error occurs (such
  740. as an SSD with open file being removed), but will simply return an error. If
  741. it is "notify" (the initial state), then it will use GenNotify to request the
  742. user to fix the problem.
  743.  
  744.  
  745. Fn $8B Sub $16
  746. GenSetNotifyState
  747.     AL: notify state
  748. Sets the notify state for the process. See GenGetNotifyState for details.
  749.  
  750.  
  751. Fn $8B Sub $17
  752. GenGetAutoSwitchOffValue
  753.     BX: -> auto-off time in seconds, or $FFFF if disabled
  754. Gets the auto-off time.
  755.  
  756.  
  757. Fn $8B Sub $18
  758. GenSetAutoSwitchOffValue
  759.     BX: auto-off time in seconds, or $FFFF to disable
  760. Sets the auto-off time.
  761.  
  762.  
  763. Fn $8B Sub $19 and $1A are for device drivers only.
  764.  
  765.  
  766. Fn $8B Sub $1B
  767. GenGetLanguageCode
  768.     AX: -> current locale code
  769. Gets the current locale code. Locale codes are listed in the Psionics file
  770. LOCALES.
  771.  
  772.  
  773. Fn $8B Sub $1C
  774. GenGetSuffixes
  775.     BX: 93 byte buffer
  776. The buffer is filled with 31 cstrs giving the correct suffix for each of the
  777. 31 days of the month. The suffix for day N is at offset (3*N-3).
  778.  
  779.  
  780. Fn $8B Sub $1D
  781. GenGetAmPmText
  782.     AL: 0=AM, 1=PM
  783.     BL: 3 byte buffer
  784. The buffer is filled with a cstr giving the correct suffix for "a.m." or
  785. "p.m." times.
  786.  
  787.  
  788. Fn $8B Sub $1E
  789. GenSetCountryData
  790.     BX: 40 byte buffer
  791. Sets the country-specific data to that in the buffer. See GenGetCountryData
  792. for the format of the buffer.
  793.  
  794.  
  795. Fn $8B Sub $1F
  796. GenGetBatteryType
  797.     AL: -> battery type
  798. Gets the battery type from the following list:
  799.     0 = Unknown
  800.     1 = Alkaline
  801.     2 = NiCaD (600)
  802.     3 = NiCaD (1000)
  803.     4 = NiCaD (500)
  804. The battery type is used to control the warning thresholds.
  805.  
  806.  
  807. Fn $8B Sub $20
  808. GenSetBatteryType
  809.     AL: battery type
  810. Sets the battery type (see GenGetBatteryType).
  811.  
  812.  
  813. Fn $8B Sub $21
  814. GenEnvBufferGet fails
  815.     AX: -> size of value
  816.     DX: length of pattern
  817.     SI: buffer filled with value
  818.     DI: pattern to search for
  819. Searches for an environment variable whose name matches the pattern (if there
  820. is more than one, which one is chosen is unspecified). The buffer is filled
  821. with the variable's value.
  822.  
  823.  
  824. Fn $8B Sub $22
  825. GenEnvBufferSet fails
  826.     CX: size of value (0 to 255)
  827.     DX: length of name (1 to 16)
  828.     SI: buffer holding value
  829.     DI: name of variable
  830. Changes the value of the specified enviromment variable, creating it first if
  831. necessary. The name may not contain wildcards.
  832.  
  833.  
  834. Fn $8B Sub $23
  835. GenEnvBufferDelete fails
  836.     DX: length of name
  837.     DI: pattern to delete
  838. Searches for an environment variable whose name matches the pattern and deletes
  839. it (if there is more than one, which one is deleted is unspecified).
  840.  
  841.  
  842. Fn $8B Sub $24
  843. GenEnvBufferFind fails
  844.     AX: -> new handle
  845.     BX: previous handle (0 for first call)
  846.     DX: length of pattern
  847.     SI: 273 byte buffer
  848.     DI: pattern to search for
  849. Searches for each environment variable whose name matches the pattern. The
  850. call is made multiple times until it fails; the same pattern must be used
  851. each time. If the call succeeds, the buffer is filled with two qstrs, the
  852. first being the name and the second the value of the variable found.
  853.  
  854.  
  855. Fn $8B Sub $25
  856. GenEnvStringGet fails
  857.     SI: 256 byte buffer
  858.     DI: pattern (cstr)
  859. Searches for an environment variable whose name matches the pattern (if there
  860. is more than one, which one is chosen is unspecified). The buffer is filled
  861. with the variable's value followed by a zero byte (thus a cstr).
  862.  
  863.  
  864. Fn $8B Sub $26
  865. GenEnvStringSet fails
  866.     SI: value (cstr)
  867.     DI: name (cstr)
  868. Changes the value of the specified enviromment variable, creating it first if
  869. necessary. The name may not contain wildcards and is limited to 16 characters;
  870. the value is limited to 255 characters.
  871.  
  872.  
  873. Fn $8B Sub $27
  874. GenEnvStringDelete fails
  875.     DI: pattern (cstr)
  876. Searches for an environment variable whose name matches the pattern and deletes
  877. it (if there is more than one, which one is deleted is unspecified).
  878.  
  879.  
  880. Fn $8B Sub $28
  881. GenEnvStringFind fails
  882.     AX: -> new handle
  883.     BX: previous handle (0 for first call)
  884.     CX: 256 byte buffer
  885.     SI: 17 byte buffer
  886.     DI: pattern to search for
  887. Searches for each environment variable whose name matches the pattern. The
  888. call is made multiple times until it fails; the same pattern must be used
  889. each time. If the call succeeds, the 17 byte buffer is filled with the name
  890. of the variable, as a cstr, and the 256 byte buffer is filled with the value
  891. followed by a zero byte (thus also a cstr).
  892.  
  893.  
  894. Fn $8B Sub $29
  895. GenCrc
  896.     AX: -> CRC
  897.     CX: buffer length
  898.     DX: previous CRC
  899.     SI: buffer
  900. Calculates the CCITT Cyclic Redundancy Checksum using the X^16+X^12+X^5+1
  901. polynomial. If the buffer is to be checked standalone, use zero as the previous
  902. checksum. If several blocks are to be checksummed as if they were one long
  903. block, use 0 for the first block, and the previous result for the remainder.
  904.  
  905.  
  906. Fn $8B Sub $2A
  907. GenRomVersion
  908.     AX: -> rom version number
  909. Gets the version of the system ROM (which includes both the operating system
  910. and many files). Version 1.23 is reported as:
  911.     $123A for alpha release
  912.     $123B for beta release
  913.     $123F for final release
  914.  
  915.  
  916. Fn $8B Sub $2B and $2C are used by the alarm server process.
  917.  
  918.  
  919. Fn $8B Sub $2D
  920. GenAlarmId
  921.     AX: -> alarm server pid
  922. Gets the process ID of the alarm server process, or 0 if none is running.
  923.  
  924.  
  925. Fn $8B Sub $2E
  926. GenPasswordSet
  927. @No documentation available at present@
  928.  
  929.  
  930. Fn $8B Sub $2F
  931. GenPasswordTest
  932. @No documentation available at present@
  933.  
  934.  
  935. Fn $8B Sub $30
  936. GenPasswordControl
  937. @No documentation available at present@
  938.  
  939.  
  940. Fn $8B Sub $31
  941. GenPasswordQuery
  942. @No documentation available at present@
  943.  
  944.  
  945. Fn $8B Sub $32
  946. GenTickle
  947.  
  948. Resets the auto-off timer. A non-active process (see GenMarkNonActive) can
  949. use this to prevent auto-off.
  950.  
  951.  
  952. Fn $8B Sub $33
  953. GenSetConfig
  954. @No documentation available at present@
  955.  
  956.  
  957. Fn $8B Sub $34
  958. GenMaskInit
  959. @No documentation available at present@
  960.  
  961.  
  962. Fn $8B Sub $35
  963. GenMaskEncrypt
  964. @No documentation available at present@
  965.  
  966.  
  967. Fn $8B Sub $36
  968. GenMaskDecrypt
  969. @No documentation available at present@
  970.  
  971.  
  972. Fn $8B Sub $37
  973. GenSetOnEvents
  974.     AL: 0=disable 1=enable
  975. Enables or disables reporting of power-on events. By default this is enabled
  976. on the Series 3 and disabled on other systems. Disabling may affect other
  977. applications.
  978.  
  979.  
  980. Fn $8B Sub $38
  981. GenGetAutoMains v3
  982.     AX: -> setting
  983. Gets the setting of the external power auto-off flag. Zero means that auto-off
  984. will take place even if external power is present, while non-zero means that
  985. auto-off is suspended while external power is present.
  986.  
  987.  
  988. Fn $8B Sub $39
  989. GenSetAutoMains v3
  990.     AL: new setting
  991. Sets the external power auto-off flag. Zero means that auto-off will take
  992. place even if external power is present (unless it has been disabled by
  993. setting the auto-off time to $FFFF), while non-zero means that auto-off is
  994. suspended while external power is present.
  995.  
  996.  
  997. Fn $8C Sub $00
  998. FloatSin fails   [sine]
  999. Fn $8C Sub $01
  1000. FloatCos fails   [cosine]
  1001. Fn $8C Sub $02
  1002. FloatTan fails   [tangent]
  1003. Fn $8C Sub $03
  1004. FloatASin fails  [arc sine]
  1005. Fn $8C Sub $04
  1006. FloatACos fails  [arc cosine]
  1007. Fn $8C Sub $05
  1008. FloatATan fails  [arc tangent]
  1009. Fn $8C Sub $06
  1010. FloatExp fails   [exponentiation (base e)]
  1011. Fn $8C Sub $07
  1012. FloatLn fails    [natural logarithm (base e)]
  1013. Fn $8C Sub $08
  1014. FloatLog fails   [decimal logarithm (base 10)]
  1015. Fn $8C Sub $09
  1016. FloatSqrt fails  [square root]
  1017.     SI: argument (real)
  1018.     DI: result (real)
  1019. Calculates the specified function of the argument. The argument and result
  1020. may be stored in the same place; if not, the argument is not altered. The
  1021. trignometric functions operate in radians.
  1022.  
  1023.  
  1024. Fn $8C Sub $0A
  1025. FloatPow fails
  1026.     DX: power (real)
  1027.     SI: base (real)
  1028.     DI: result (real)
  1029. Calculates the result of raising the base to the indicated power. The result
  1030. may be stored in the same place as either argument; if not, neither argument
  1031. is altered.
  1032.  
  1033.  
  1034. Fn $8C Sub $0B
  1035. FloatRand
  1036.     SI: seed (long)
  1037.     DI: result (real)
  1038. Generates a random real number based on the unsigned long integer seed, which
  1039. is unaltered; the memory used for the two should not overlap.
  1040.  
  1041.  
  1042. Fn $8C Sub $0C
  1043. FloatMod fails
  1044.     DX: divisor (real)
  1045.     SI: dividend (real)
  1046.     DI: result (real)
  1047. Calculates the dividend modulo the divisor, using the formula:
  1048.     result = dividend - divisor * FloatInt (dividend/divisor)
  1049. The result may be stored in the same place as either argument; if not, neither
  1050. argument is altered.
  1051.  
  1052.  
  1053. Fn $8C Sub $0D
  1054. FloatInt fails
  1055.     SI: argument (real)
  1056.     DI: result (real)
  1057. Rounds the argument to the closest integer towards zero (i.e. zeros the
  1058. fractional part of the argument). The argument and result may be stored in the
  1059. same place; if not, the argument is not altered.
  1060.  
  1061.  
  1062.  
  1063. Further system calls are described in Psionics file SYSCALLS.3.
  1064.